﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;

namespace UI
{
    public class Printer
    {
        [Display(Name = "IP Address", Description = "Enter the IP Address of the printer.", Order = 1)]
        public string IPAddress
        {
            get{return (age);}
            set
            {
                Regex r = new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
                if (!r.IsMatch(value))
                {
                    throw new InvalidOperationException("Incorrect Format");
                }
                age = value;
            }
        }
        private string age;
        [Display(Name = "Manufacturer", Description = "Enter the manufacturer of the printer.", Order = 6)]
        public string Make { get; set; }
        [Display(Order = 7)]
        public string Model { get; set; }
        [Display(Order = 8)]
        public string xCord { get; set; }
        [Display(Order = 9)]
        public string yCord { get; set; }
        [Display(Order = 10)]
        [Bindable(true, BindingDirection.OneWay)]
        public int id { get; set; }
        [Display(Order = 4)]
        public string floor { get; set; }
        [Display(Order = 5)]
        public string room { get; set; }
        [Display(Order = 3)]
        public string building { get; set; }
        [Display(Order = 2)]
        public string campus { get; set; }
    }
}
